package com.ruoyi.api.utils;


import com.ruoyi.api.vo.ApiDemo;
import com.ruoyi.api.vo.CollectApi;

import java.util.Arrays;


/**
 * 收藏类型转换
 */
public class SysCollect {

    public CollectApi sysCollects(ApiDemo apiDemo) {
        CollectApi collectApi = new CollectApi();
        collectApi.setPictures(Arrays.toString(apiDemo.getPictures()));
        collectApi.setAddress(apiDemo.getAddress());
        collectApi.setCity(apiDemo.getCity());
        collectApi.setDistrict(apiDemo.getDistrict());
        collectApi.setIsSelect(apiDemo.getIsSelect());
        collectApi.setLocation(apiDemo.getLocation());
        collectApi.setName(apiDemo.getName());
        return collectApi;
    }

    public ApiDemo sysApiDemo(CollectApi collectApi) {
        ApiDemo apiDemo = new ApiDemo();
        apiDemo.setPictures(collectApi.getPictures().split(""));
        apiDemo.setAddress(collectApi.getAddress());
        apiDemo.setCity(collectApi.getCity());
        apiDemo.setDistrict(collectApi.getDistrict());
        apiDemo.setIsSelect(collectApi.getIsSelect());
        apiDemo.setName(collectApi.getName());
        apiDemo.setLocation(collectApi.getLocation());
        return apiDemo;
    }
}
